using System;
using Deepcode.Flux.Core.Codons;
using Deepcode.Flux.Core.Extensions;
using Deepcode.Flux.Core.Extensions.Codons;
using Deepcode.Flux.Core.Systems.UI.Taskpad;

namespace Deepcode.Flux.Core.Codons.Taskpad
{
	/// <summary>
	/// <TaskpadTab 
	///		id="padTabMyActivity" 
	///		title="My Activity">
	/// 
	/// Codon representing a taskpad tab
	/// 
	/// </summary>
	[XmlCodonName("TaskpadTab")]
	public class TaskpadTabCodon : AbstractCodon
	{
		[XmlCodonAttribute("title")]
		private string title = "";

		public override object BuildItem(object owner, System.Collections.ArrayList subItems)
		{
			// Only return an object if we have items...
			if( subItems.Count < 1 ) return null;
		
			TaskpadTab tab = new TaskpadTab( this.ID, title, subItems );
			return tab;
		}
	}
}
